package fzdy.dao.impl;

import fzdy.core.dao.impl.BaseDaoImpl;
import fzdy.dao.ISysmoduleDao;
import fzdy.entity.Sysmodule;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysmoduleDao extends BaseDaoImpl<Sysmodule> implements ISysmoduleDao {

    @Override
    public List<Sysmodule> getusermenudata(Integer roleId) {
        String hql="select sm from Sysmodule as sm, SysRoleRight as srr " +
                "where srr.moduleId  = sm.id and srr.roleId=:roleid ";
        Query query   =  getSession().createQuery(hql);
        query.setParameter("roleid",roleId);
        return query.list();
    }
}
